﻿
@{
    ViewBag.Title = "ImportFromWeb";
    Layout = "~/Views/Shared/_ManagerLayout.cshtml";
}

<form class="form-inline">
    <input id="url" name="url" type="text" class="form-control" style="width:80%"/>
    <button type="button" id="btnSubmit" class="btn btn-success">提交</button>
    <button type="button" id="btnResolve" class="btn brn-info">解析</button>
</form>
<iframe name="iframe" id="iframe" style="width:100%; height: 600px; margin-top:25px; border-style: solid; border-width: 1px; border-color:#A1A1A1">

</iframe>
@section Script{
    <script>
        $(function () {
            $("#btnSubmit").on("click", function () {
                var url = $("#url").val();
                //$("#web").attr("src", url);
                $(window.parent.document).find("#iframe").attr("src", url);
            });
            $("#btnResolve").on("click", function () {
                var body = $(window.frames["iframe"].document).find("#body").val() + "";
                alert(body);
            });
        })
        
    </script>    
}